package com.ideaaedi.zoo.example.springboot.seata_dynamicds.beta.service;

import com.ideaaedi.zoo.example.springboot.seata_dynamicds.beta.po.StudentPO;
import com.ideaaedi.zoo.example.springboot.seata_dynamicds.beta.po.TeacherPO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class BizService {
    
    @Autowired
    BizService4Basic bizService4Basic;
    
    /**
     * 写入一些数据
     */
    public void addSomeBetaData() {
        int id = (int)System.currentTimeMillis() % 1000000;
        // 插入数据
        bizService4Basic.insertStudent(StudentPO.builder().id(id).name("Beta 夏洛").build()); // 数据库 mysql  db_one
        bizService4Basic.insertTeacher(TeacherPO.builder().id(id).name("Beta 蒋老师").build()); // 数据库 oracle  ROOT.teacher
    }
}
